-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev: Add Keystone embed with Bookmark and Collection #213
Conversation
@@ -1,6 +1,5 @@ | |||
module.exports = { | |||
testPathIgnorePatterns: ['/node_modules/', '.next/', 'cypress/'], | |||
moduleDirectories: ['node_modules/', '.'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing babel transform errors when trying to test Keystone 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this change (if anything) moving forward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add directories under src/
that we want to be able to import from using absolute paths, they'll need to be added to this file so Jest can resolve the imports correctly
"storybook-css-modules-preset": "1.1.1", | ||
"style-loader": "2.0.0", | ||
"typescript": "4.4.2" | ||
}, | ||
"resolutions": { | ||
"@babel/runtime": "7.15.4" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up updating a bunch of packages because there were some incompatibilities causing Storybook to not run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
Description
This PR adds Keystone CMS in embedded mode so that we can develop the portal application against a CMS, prior to standing the CMS up as its own service. This approach is described in this ADR.
The Keystone entrypoint is added at
keystone.ts
-- this is where Keystone bootstraps all config, database settings, and the content schema. I added a basic schema for Bookmarks and Collections, as well as some corresponding tests.schema.graphql
andschema.prisma
are both generated by Keystone but should be checked into VCS.This also exposes a local URL for viewing the GraphQL API at: http://localhost:3000/api/graphql
I also did a little bit of housekeeping, updating
.eslintignore
&.prettierignore
files.Fixes #78
Review Notes
This has to be tested locally since Keystone-embed only works in local development. To test, check out this branch and run:
This should expose two URLs:
http://localhost:3000/ - the portal site
http://localhost:8000/ - the Keystone admin UI
Verify you can add Bookmarks/Collections as expected. Note that these aren't surfaced in the UI anywhere yet, so there is nothing to test in the portal itself (yet!). If you add content using the admin UI, there should be changes made to the
cms.db
file.